home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / metata1a / frmmain.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-10-18  |  7.4 KB  |  210 lines

  1. VERSION 5.00
  2. Begin VB.Form frmMain 
  3.    Caption         =   "Meta Tag Creator"
  4.    ClientHeight    =   4050
  5.    ClientLeft      =   165
  6.    ClientTop       =   735
  7.    ClientWidth     =   5625
  8.    ClipControls    =   0   'False
  9.    Icon            =   "frmMain.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    ScaleHeight     =   4050
  13.    ScaleWidth      =   5625
  14.    StartUpPosition =   3  'Windows Default
  15.    Begin VB.Frame Frame1 
  16.       Caption         =   "Output Options"
  17.       Height          =   975
  18.       Left            =   240
  19.       TabIndex        =   11
  20.       Top             =   2760
  21.       Width           =   1935
  22.       Begin VB.OptionButton opthtml 
  23.          Caption         =   "Create tags.html"
  24.          Height          =   375
  25.          Left            =   120
  26.          TabIndex        =   9
  27.          Top             =   480
  28.          Width           =   1575
  29.       End
  30.       Begin VB.OptionButton optclip 
  31.          Caption         =   "Copy to clipboard"
  32.          Height          =   255
  33.          Left            =   120
  34.          TabIndex        =   8
  35.          Top             =   240
  36.          Value           =   -1  'True
  37.          Width           =   1695
  38.       End
  39.    End
  40.    Begin VB.TextBox txtCopy 
  41.       Height          =   285
  42.       Left            =   1680
  43.       TabIndex        =   7
  44.       Top             =   2160
  45.       Width           =   2535
  46.    End
  47.    Begin VB.CommandButton cmdCreate 
  48.       Caption         =   "&Create Code"
  49.       Height          =   495
  50.       Left            =   4080
  51.       TabIndex        =   10
  52.       Top             =   3240
  53.       Width           =   1215
  54.    End
  55.    Begin VB.TextBox txtAuthor 
  56.       Height          =   285
  57.       Left            =   1680
  58.       TabIndex        =   5
  59.       Top             =   1680
  60.       Width           =   2535
  61.    End
  62.    Begin VB.TextBox txtKeyWords 
  63.       Height          =   405
  64.       Left            =   1680
  65.       MultiLine       =   -1  'True
  66.       TabIndex        =   3
  67.       Top             =   1080
  68.       Width           =   2535
  69.    End
  70.    Begin VB.TextBox txtDesc 
  71.       Height          =   645
  72.       Left            =   1680
  73.       MultiLine       =   -1  'True
  74.       TabIndex        =   1
  75.       Top             =   240
  76.       Width           =   2535
  77.    End
  78.    Begin VB.Label Label3 
  79.       AutoSize        =   -1  'True
  80.       BackStyle       =   0  'Transparent
  81.       Caption         =   "Ver 1.00"
  82.       Height          =   195
  83.       Index           =   1
  84.       Left            =   4920
  85.       TabIndex        =   12
  86.       Top             =   3840
  87.       Width           =   600
  88.    End
  89.    Begin VB.Line Line1 
  90.       X1              =   5640
  91.       X2              =   0
  92.       Y1              =   0
  93.       Y2              =   0
  94.    End
  95.    Begin VB.Label Label4 
  96.       AutoSize        =   -1  'True
  97.       Caption         =   "Site C&opyright:"
  98.       Height          =   195
  99.       Left            =   240
  100.       TabIndex        =   6
  101.       Top             =   2160
  102.       Width           =   1020
  103.    End
  104.    Begin VB.Label Label3 
  105.       AutoSize        =   -1  'True
  106.       Caption         =   "Site &Keywords:"
  107.       Height          =   195
  108.       Index           =   0
  109.       Left            =   240
  110.       TabIndex        =   2
  111.       Top             =   1200
  112.       Width           =   1050
  113.    End
  114.    Begin VB.Label Label2 
  115.       AutoSize        =   -1  'True
  116.       Caption         =   "Site A&uthor:"
  117.       Height          =   195
  118.       Left            =   240
  119.       TabIndex        =   4
  120.       Top             =   1680
  121.       Width           =   825
  122.    End
  123.    Begin VB.Label Label1 
  124.       AutoSize        =   -1  'True
  125.       Caption         =   "Site &Description:"
  126.       Height          =   195
  127.       Left            =   240
  128.       TabIndex        =   0
  129.       Top             =   240
  130.       Width           =   1155
  131.    End
  132.    Begin VB.Menu mnuFile 
  133.       Caption         =   "&File"
  134.       Begin VB.Menu mnuHtml 
  135.          Caption         =   "&Create html file"
  136.       End
  137.       Begin VB.Menu mnuClip 
  138.          Caption         =   "C&opy to Clipboard"
  139.       End
  140.       Begin VB.Menu mnuHorizontal 
  141.          Caption         =   "-"
  142.       End
  143.       Begin VB.Menu mnuexit 
  144.          Caption         =   "E&xit"
  145.       End
  146.    End
  147.    Begin VB.Menu mnuHelp 
  148.       Caption         =   "&Help"
  149.       Begin VB.Menu mnuHelp1 
  150.          Caption         =   "&Help"
  151.       End
  152.       Begin VB.Menu mnuAbout 
  153.          Caption         =   "&About"
  154.       End
  155.    End
  156. Attribute VB_Name = "frmMain"
  157. Attribute VB_GlobalNameSpace = False
  158. Attribute VB_Creatable = False
  159. Attribute VB_PredeclaredId = True
  160. Attribute VB_Exposed = False
  161. Option Explicit
  162. Private Sub cmdCreate_Click()
  163.     Dim html As String 'declares html varible (for the tags)
  164.     Dim filelocation As String 'declares filelocation variable (for save path)
  165.     Dim clipboard As String 'declares clipboard variable
  166.     'creates html file code
  167.     html = "<HTML>" & vbNewLine & "<HEAD>" & vbNewLine & "<TITLE>Meta Tags</TITLE>" & vbNewLine & "</HEAD>" & vbNewLine & "<META NAME=" & Chr(34) & "description" & Chr(34) & " content=" & Chr(34) & txtDesc.Text & Chr(34) & "> " & vbNewLine & "<META NAME=" & Chr(34) & "keywords" & Chr(34) & " content=" & Chr(34) & txtKeyWords.Text & Chr(34) & ">" & vbNewLine & "<META NAME=" & Chr(34) & "author" & Chr(34) & " content=" & Chr(34) & txtAuthor.Text & Chr(34) & ">" & vbNewLine & "<META NAME=" & Chr(34) & "Copyright" & Chr(34) & " content=" & Chr(34) & txtCopy.Text & Chr(34) & ">" & vbNewLine & "<body>" & vbNewLine & "<P> Created by: Meta Tags! by Nick Bodmer - <a href=" & Chr(34) & "http://www.fulcrum.nu" & Chr(34) & ">http://www.fulcrum.nu</a> </p>" & vbNewLine & "</body>" & vbNewLine & "</html>"
  168.     'creates html file save path
  169.     filelocation = App.Path & "\tags.html"
  170.     'creates clip board code
  171.     clipboard = "<META NAME=" & Chr(34) & "description" & Chr(34) & " content=" & Chr(34) & txtDesc.Text & Chr(34) & "> " & vbNewLine & "<META NAME=" & Chr(34) & "keywords" & Chr(34) & " content=" & Chr(34) & txtKeyWords.Text & Chr(34) & ">" & vbNewLine & "<META NAME=" & Chr(34) & "author" & Chr(34) & " content=" & Chr(34) & txtAuthor.Text & Chr(34) & ">" & vbNewLine & "<META NAME=" & Chr(34) & "Copyright" & Chr(34) & " content=" & Chr(34) & txtCopy.Text & Chr(34) & ">"
  172.     If optclip = True Then
  173.         'code for copying to clipboards
  174.         clipboard.SetText (clipboard)
  175.     Else
  176.         'code for writing html file
  177.         Open filelocation For Output As #1
  178.             Print #1, html
  179.         Close #1
  180.     End If
  181. End Sub
  182. Private Sub mnuAbout_Click()
  183.     'Loads the about screen
  184.     frmAbout.Show
  185.     frmMain.Hide
  186. End Sub
  187. Private Sub mnuexit_Click()
  188.     End     'does this really need commenting? well, it exits program
  189. End Sub
  190. Private Sub txtAuthor_GotFocus()
  191.     'highlights text when textbox has focus
  192.     txtAuthor.SelStart = 0
  193.     txtAuthor.SelLength = Len(txtAuthor.Text)
  194. End Sub
  195. Private Sub txtCopy_GotFocus()
  196.     'highlights text when textbox has focus
  197.     txtCopy.SelStart = 0
  198.     txtCopy.SelLength = Len(txtCopy.Text)
  199. End Sub
  200. Private Sub txtDesc_GotFocus()
  201.     'highlights text when textbox has focus
  202.     txtDesc.SelStart = 0
  203.     txtDesc.SelLength = Len(txtDesc.Text)
  204. End Sub
  205. Private Sub txtKeyWords_GotFocus()
  206.     'highlights text when textbox has focus
  207.     txtKeyWords.SelStart = 0
  208.     txtKeyWords.SelLength = Len(txtKeyWords.Text)
  209. End Sub
  210.